package com.xpf.service.process;

import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import java.util.List;

public class OperateBaseProcessFactory {


    @Autowired
    private List<LanDrayCommonProcessStrategy> lanDrayStrategyList;

    public LanDrayCommonProcessStrategy getLanDrayProcessStrategy(String processKey){
        if(StringUtils.isNotEmpty(processKey) && CollectionUtils.isNotEmpty(lanDrayStrategyList)){
            for(LanDrayCommonProcessStrategy strategy: lanDrayStrategyList){
                if(processKey.equals(strategy.getProcessKey())){
                    return strategy;
                }
            }
        }
        return null;
    }
}
